<?php

namespace Common\Model;

/**
 * ServerModel.class.php实例模型
 * 
 * @author wenhui
 * @date 2017-011-09
 */
class ServerInfoModel extends BaseModel {

    protected $trueTableName = 'tb_server_info';

    /**
     * 添加数据
     * @modify wenhui 2017-011-09
     * @param integer $name  服务名称
     * @return type
     */
    public function addInfo($data) {
        return $this->addAll($data);
    }

    /**
     * 添加数据
     * @modify wenhui 2017-011-09
     * @param integer $name  服务名称
     * @return type
     */
    public function saveInfo($serverId, $language, $name, $description) {
        $option = array(
            'server_id' => $serverId,
            'language' => $language,
        );

        $data['name'] = $name;
        $data['description'] = $description;

        return $this->where($option)->save($data) === false ? false : true;
    }
}
